ntos ambari agent

# Version 1.0

FROM centos:6.6
MAINTAINER      hucw    <hu.cwei@qq.com>

RUN yum -y install openssh openssh-server openssh-clients \
	scp unzip tar curl wget sudo \
        && sed -i 's/UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config \
        && rm -rf /var/cache/yum/* \
        && yum clean all

RUN ssh-keygen -q -t dsa -f /etc/ssh/ssh_host_dsa_key \
        && ssh-keygen -q -t rsa -f /etc/ssh/ssh_host_rsa_key \
        && mkdir /var/run/sshd

USER root

RUN echo root:goodbaby | chpasswd

RUN mkdir /root/.ssh \     
        && chmod 700 /root/.ssh

ADD etc/authorized_keys /root/.ssh/
                                                    
RUN chmod 600 /root/.ssh/authorized_keys 

# install Ambari specified 1.7 jdk      
ENV VERSION 7                           
ENV UPDATE 80                           
ENV BUILD 15                            
RUN curl --silent --location --retry 3 --cacert /etc/ssl/certs/GeoTrust_Global_CA.pem \
        --header "Cookie: oraclelicense=accept-securebackup-cookie;" \                 
        http://download.oracle.com/otn-pub/java/jdk/"${VERSION}"u"${UPDATE}"-b"${BUILD}"/jdk-"${VERSION}"u"${UPDATE}"-linux-x64.tar.gz \
        | tar xz -C /tmp && \                                                                                                           
        mkdir -p /usr/lib/jvm && mv /tmp/jdk1.${VERSION}.0_${UPDATE} "${JAVA_HOME}"

EXPOSE 22                  
                           
CMD ["/usr/sbin/sshd","-D"]
